                                                     ***********************     
                                                     *   SRS DOCUMENT      *
                                                     ***********************

******INTRODUCTION******** 

**Project Title – “Bus Ticket Reservation system”.
**Feasibility of the project - India is one of the most populated as well as fastest growing countries of the world. With the changing economic pattern better infrastructure and transportation system have developed to support the development. One of the mostly used modes of transport is Bus Service. Although the origination of bus service can be dated before the Independence but with increasing demand the system has become more modern and effective. Now several Government as well as private organization runs buses to different destinations and they need to handle lot of traffic and passengers daily with different requirements. So our project “Bus Ticket Reservation System” will be very much acceptable in this situation as it will provide a lot of facilities together(e.g. reservation, cancellation, enquiry etc.) and all the works will be much less time consuming, correct and will require less man-power. Thus they can efficiently provide better customer service.
**Members:    
                                  1.Dev Narayan (Team Leader)           110050032             7 hrs 20 mnts
                                  2.Devesh Kumar                        115090019             5 hrs 11 mnts
                                  3.Dan Singh Meena                     110040042             5 hrs 10 mnts
                                  4.Debanjan Guha Roy                   115060022             6 hrs 34 mnts
                                  5.Gaurav Kumar                        110010039             5 hrs
                                  6.Gourab Bhattacharya                 115060019             5hrs 05 mnts
                                  7.Gaurav Mani.                        100100069             5 hrs
          T.A.:- Amitkumar Patil

******APPROACH TO THE PROBLEM********

       (a) Team Discussion - Three team meetings were organized in each weak after the declaration of project apart from weakly scheduled lab classes. The time of discussions range from 20 minutes to 1 hr. Several small scale meetings among 2-3 members were also taken place. Exchange of thought, advices, suggetions were also done by google group mailing and gmail chat.
       (b) Analysis of Existing systems - Before starting the designing of the final algorithm and functions, several already existing bus reservation systems of different bus companies were studied and required facilities were note down. The ticket booking system of Indian Railways was studied thoroughly to get a compact and comprehensive idea about the ticket booking system.
       (c) Study of Old Projects - Study of several old incomplete, attempted and complete projects were done to get an initial idea about the problems needed to be handeled and the way team should proceed to complete the project within given time limit. 

******PROBLEM DEFINITION********* 

      Our program deals with the reservation of tickets of a bus system. This program is consist of several features which can be used in all bus services  like reservation of current and advance tickets, cancellation of already reserved ticket, enquiry about the route and the status of the booked tickets. We are likely to include a part for administrator of the system to control the available facilities and information. An administrator can see the list of the passengers of any bus on a particular date or duration of times.
   We are using 4 buses in our service. The origination of journey is Mumbai and they will go to four destinations namely Bangalore, Ahemdabad, Bhopal and Goa. We have associated four files, one for each bus, Bus1.dat, Bus2.dat, Bus3.dat and Bus4.dat respectively. Every passenger details are stored in corresponding file regardless of date. When needed, information can be read from or written into these files and displayed on the output screen.

******FUNCTION SPECIFICATIONS******
void fnMainScreen();
/*this function shows the initial screen or main menu*/
Void fnprintline();
/*this function displays  a bunch of ‘*’ (asterisk) in a line to differentiate different part of the display*/

void fnreservation(int);       Gaurav Kumar
//user will give his choice 1/2/3/4 and we will work on respective destination

void fncancellation( );         Dev Narayan
/*for cancelling a booked ticket. User needs to input his choice of destination and ticket no. and this function will cancel the ticket if the entries are valid, otherwise it will display an error message. After cancellation the seat will be shown vacant for further reservation*/

void fnenquiry( );                Gourav Bhattacharya
/*under enquiry we are going to work with features like seat availability ,bus running information, rules, passenger list, ticket status*/
/*as the user opt  for enquiry, choices for  several sub-enquiries will be displayed and he need to choose among them, depending upon his requirement.*/  

void fnseatavailability( );     Gourav Bhattacharya 
/* this comes under enquiry section. On a particular date in a particular bus we will show the number of seat vacant and occupied. User needs to enter the date and destination choice on which he wants to see the availability. This function will show the no. of seats vacant. If full, a message will be displayed.*/

void fnBusRunninginfo( );    Dan Singh Meena
/*this comes under enquiry section. User needs to enter the destination choice and the system will display the complete route, stoppage and duration of journey.*/  
void fnRules( );                  Gaurav Mani
// this comes under enquiry section. It will only show the rules of travelling. 

void fnPassengerlist( );       Gaurav Mani
/*this comes under administrative section. )n a particular date in a particular bus it will show the list of the passenger and their details.*/

Void fnTicketStatus( );         Debanjan Guha Roy
//*this comes under enquiry section. whenever user comes to enquire his ticket, user needs to input destination choice and ticket no. and it will display the total information of his/her reservation*/

void fnShowTicket(int,int,int);      Devesh
//when the reservation is complete, it will display the ticket in a pre-defined //fashion. It will take three parameters Destination choice, Seat no. and Ticket no.
void fnseatno(int,int,int);           Dev Narayan  
// this function deals with the allotment of the seats.

*********USER INTERFACE REQUIREMENTS********* 

The user and the administrator must have the following requirements: ­
1. He must have Ubuntu OS.
2. He must have the package of the EzWindows that will be attached with the  program. ( it is likely to be added in the second stage).
3. The input keys must be typed in the terminal.

***********DESCRIPTION OF DATA ( INPUT AND OUTPUT)************* -

class bus
{
int seatno;
/*seat no will be allocated to the user in a specific manner such that only empty seats come into account.*/

char name[30];
int age;
char sex;    //  M/F
int date;
int month;
int ticketno;

public:
member functions described above
}
  User needs to continuously enter his details as the program proceeds. He needs to enter his personal details at the time of reservation. Ticketno is the main tool using which he can get the available facilities.

**************DESIGN OF ALGORITHM*******************

      We have defined a class ‘Bus’ which has attributes seat no, name, age, sex, date, month and ticket no. there are publicly defined member functions of fnreservation, fncancellation, fnenquary, fnseatno, fnseatavailability, fn busrunninginfo, fnticketstatus, fnshowticket, fnrules, fnpassangerlist. We have defined to separate functions fnmainscreen and fnprintline .
      As we run the program, user needs to input his choice among bus reservation, ticket cancellation and enquiry.
      Under the bus reservation system shows the four destination service we provide that is Bangalore , Ahemdabad, Bhopal and Goa. He needs to input his choice of destination which will be stored in variable choice. We will call fnreservation() with parameter 'choice' to reserve his ticket to corresponding destination.  Under fnreservation function, user needs to enter his name, age, sex, date of journey. We will calculate the ticket no by his input using the formula   [(Date)*100000+(Month)*1000+(Choice)*100+(Seat no)]. After completing the reservation we are writing his details in a file. We have created one file for each bus.  Then we are calling a function fnshowticket. This function will start reading the file , when it finds the details which matches with the user details. It will display it in an organized format. Under fnreservation function we have called a fnseatno which decides what seat is to be allocated to a particular passenger of particular date. A function fnseatno() is invoked under the reservation function. This function starts reading the records from a particular bus on a particular date, enquires a seat whether empty or full. It then starts allocating the empty seat serial wise.
     Under ticket cancellation we are opening two files, let ‘Bus1.dat’ and ‘Bus5.dat’. user inputs his destination choice in a variable ‘choice1’ and his ticket no. we will start searching his details from file ‘Bus1.dat’. if found, we will display his ticket details with a message ‘THE TICKET HAS BEEN CANCELLED AND YOU WILL BE REFUNDED 70% OF THE FARE’. We will copy rest of the passengers data excluding him in a file ‘Bus5.dat’. Next we remove ‘Bus1.dat’ and rename ‘Bus5.dat’ by ‘Bus1.dat’. if his record is not found, the message displays ‘THE SEAT IS EMPTY’.
     Under enquiry user needs to enter a choice among sub-enquiries. The sub-enquiries are Ticket Status, Seat availability, Bus Running Information, and Rules of Bus Service. In each case, corresponding function is called to perform the task.
     Under Ticket Status user needs to enter his destination choice and ticket number. Accordingly the program search in the respective file. When ticket  entered by the user matches with the ticketno read from the file it will show his details of the journey. If no match found, a message saying “YOUR SEAT IS NOT RESERVED” is displayed.
     Under seat availability user is helped in a way if he wants to enquire the available seat on a particular dates. So, he needs to enter the dates and month on which he wants to check the availability as well as his destination choice. A function fnseatavailability() first opens the file of that particular bus, counts the number of seats occupied on that particular date and display the availability details. If all the 40 seats are occupied, a message saying “ SORRY!!! NO SEAT AVAILABLE” is displayed.
     Under Bus running information, a function fnbusrunninginfo() works. This functions takes into account the user choice of destination and displays the complete route of that bus ( total stoppage between source and destination, duration of stoppage, arrival and departure time).
     Under Rules of bus service, a function fnrules() reads from a file and display a set of rules which are to be followed by the passenger during the course of journey.
    



*************SAMPLE CODE*******************

...............................
    Function Cancellation
...............................

    void bus::fncancellation()
{
	system("reset");
        int ticket;
	FILE *fp1,*fp2;
	int flag=1;
	int choice1;
	
	printf("\n\n\t\t CANCELLATION OF RESERVED TICKET");
	fnPrintLine();

	cout<<"\n\n\t\t PRESS 1. MUMBAI TO BANGALORE";
	cout<<"\n\t\t PRESS 2. MUMBAI TO AHEMDABAD";
	cout<<"\n\t\t PRESS 3. MUMBAI TO BHOPAL";
	cout<<"\n\t\t PRESS 4. MUMBAI TO GOA";
	cout<<"\n\n\t\t PRESS 5. MAIN MENU";
	cout<<"\n\n\n\n Enter You Choice:";
	cin>>choice1;
	
	cout<<"\n\n Enter the TICKET NUMBER of the passenger:"<<endl;
	cin>>ticket;
	
		switch(choice1){
		case 1 : fp1=fopen("bus1.dat","rb");
			 fp2=fopen("bus5.dat","ab");
			 while(fread(&b,sizeof(bus),1,fp1))  //reading from "bus1.dat"
			 {
			  if (ticket==ticketno)
			  {
			   system("reset");
			   fnPrintLine();
			   cout<<"\n\n\n\t Ticket No: "<<ticketno;
			   cout<<"\n\n\t Seat No: "<<seatno;
			   cout<<"\n\tNAME: "<<name;
			   cout<<"\n\t AGE: "<<age;
			   cout<<"\n\t SEX: "<<sex;
			   cout<<"\n\n\t FARE: Rs 400 \t FROM: mumbai";
			   cout<<"\n\t DESTINATION: Bangalore \t TIME: 0600 hrs";
			   cout<<"\n\tDATE OF JOURNEY: "<<date<<"/"<<month<<endl;
			   fnPrintLine();

			   flag=0;
			   }
			   else{
			        fwrite(&b,sizeof(bus),1,fp2);
			       }
			  } //while loop closed
			  
			  fclose(fp1);
			  fclose(fp2);
			  remove("bus1.dat");
			  rename("bus5.dat","bus1.dat");	/*replacing "bus5.dat" by "bus1.dat"*/
			
			  if (flag==1)
			  cout<<"\n\n\n\t\t THE SEAT IS EMPTY";
			  else
			  {
			  cout<<"\n\n\n\t\tTHE TICKET HAS BEEN CANCELLED";
			  COUT<<"\n\t\tYOU WILL BE REFUNDED 70% OF THE FARE";
			  }
		
			  break;


		case 2 : fp1=fopen("bus2.dat","rb");
			 fp2=fopen("bus5.dat","ab");
			 while(fread(&b,sizeof(bus),1,fp1)) //reading from "bus2.dat"
			 {
			  if (ticket==ticketno)
			  {
			   system("reset");
			   fnPrintLine();
			   cout<<"\n\n\n\t Ticket No: "<<ticketno;
			   cout<<"\n\n\t Seat No: "<<seatno;
			   cout<<"\n\tNAME: "<<name;
			   cout<<"\n\t AGE: "<<age;
			   cout<<"\n\t SEX: "<<sex;
			   cout<<"\n\n\t FARE: Rs 350 \t FROM: mumbai";
			   cout<<"\n\t DESTINATION: Ahemdabad \t TIME: 0830 hrs";
			   cout<<"\n\tDATE OF JOURNEY: "<<date<<"/"<<month<<endl;
			   fnPrintLine();

			   flag=0;
			   }
			   else{
			        fwrite(&b,sizeof(bus),1,fp2);   //writing on "bus5.dat"
			       }
			  } //while loop closed
			  
			  fclose(fp1);
			  fclose(fp2);
			  remove("bus2.dat");
			  rename("bus5.dat","bus2.dat");	/*replacing "bus5.dat" by "bus2.dat"*/
			
			  if (flag==1)
			  cout<<"\n\n\n\t\t THE SEAT IS EMPTY";
			  else
			  {
			  cout<<"\n\n\n\t\tTHE TICKET HAS BEEN CANCELLED";
			  COUT<<"\n\t\tYOU WILL BE REFUNDED 70% OF THE FARE";
			  }
		
			  break;

 
		case 3 : fp1=fopen("bus3.dat","rb");
			 fp2=fopen("bus5.dat","ab");
			 while(fread(&b,sizeof(bus),1,fp1))   //reading from "bus3.dat"
			 {
			  if (ticket==ticketno)
			  {
			   system("reset");
			   fnPrintLine();
			   cout<<"\n\n\n\t Ticket No: "<<ticketno;
			   cout<<"\n\n\t Seat No: "<<seatno;
			   cout<<"\n\tNAME: "<<name;
			   cout<<"\n\t AGE: "<<age;
			   cout<<"\n\t SEX: "<<sex;
			   cout<<"\n\n\t FARE: Rs 310 \t FROM: mumbai";
			   cout<<"\n\t DESTINATION: Bhopal \t TIME: 0900 hrs";
			   cout<<"\n\tDATE OF JOURNEY: "<<date<<"/"<<month<<endl;
			   fnPrintLine();

			   flag=0;
			   }
			   else{
			        fwrite(&b,sizeof(bus),1,fp2);     //writing on "bus5.dat"
			       }
			  } //while loop closed
			  
			  fclose(fp1);
			  fclose(fp2);
			  remove("bus3.dat");   	
			  rename("bus5.dat","bus3.dat");  /*replacing "bus5.dat" by "bus3.dat"*/
			
			  if (flag==1)
			  cout<<"\n\n\n\t\t THE SEAT IS EMPTY";
			  else
			  {
			  cout<<"\n\n\n\t\tTHE TICKET HAS BEEN CANCELLED";
			  COUT<<"\n\t\tYOU WILL BE REFUNDED 70% OF THE FARE";
			  }
		
			  break;


    		case 4 : fp1=fopen("bus4.dat","rb");
			 fp2=fopen("bus5.dat","ab");
			 while(fread(&b,sizeof(bus),1,fp1))    //reading from "bus4.dat"
			 {
			  if (ticket==ticketno)
			  {
			   system("reset");
			   fnPrintLine();
			   cout<<"\n\n\n\t Ticket No: "<<ticketno;
			   cout<<"\n\n\t Seat No: "<<seatno;
			   cout<<"\n\tNAME: "<<name;
			   cout<<"\n\t AGE: "<<age;
			   cout<<"\n\t SEX: "<<sex;
			   cout<<"\n\n\t FARE: Rs 200 \t FROM: mumbai";
			   cout<<"\n\t DESTINATION: Goa \t TIME: 0430 hrs";
			   cout<<"\n\tDATE OF JOURNEY: "<<date<<"/"<<month<<endl;
			   fnPrintLine();

			   flag=0;
			   }
			   else{
			        fwrite(&b,sizeof(bus),1,fp2);     //writing on "bus5.dat"
			       }
			  } //while loop closed
			  
			  fclose(fp1);
			  fclose(fp2);
			  remove("bus4.dat");
			  rename("bus5.dat","bus4.dat");	/*replacing "bus5.dat" by "bus4.dat"*/
			
			  if (flag==1)
			  cout<<"\n\n\n\t\t THE SEAT IS EMPTY";
			  else
			  {
			  cout<<"\n\n\n\t\tTHE TICKET HAS BEEN CANCELLED";
			  COUT<<"\n\t\tYOU WILL BE REFUNDED 70% OF THE FARE";
			  }
		
			  break;

		case 5 : system("reset");
		         fnMainScreen();   //returning to main screen
		         
	         	 break;

		default : cout<<"\n\n\t WRONG INPUT";
			  exit(0);
			
			} //switch closed here
			} //function closed here

........................
    Function Enquiry
........................

void bus::fnEnquiry()
{
	 system("Reset")
		int choice2;
		printf("\n\n\t WELCOME TO ENQUIRY SECTION");
		printf("\n\n\t WE ARE THANFFUL TO HELP YOU");

	fnPrintline();
	cout<<"\n\n\t\t PRESS1: TICKET STATUS";
	cout<<"\n\t\t PRES2: SEAT AVAILABILITY";
	cout<<"\n\t PRESS3: BUS RUNING INFORMATION";
	cout<<"\n\t\t PRES4: RULES OF BUS SERVICE";
	cout<<"\n\n\t PRESS5: MAIN MENU";
	cout<<"\n\n\t\t ENTER YOUR CHOICE";
	cin>>choice2;

switch(choice2)
{
	case 1: 
	fnTicketStatus(); 
	break;
	case 2: 
	fnSeatAvailability(); 
	break;
	case 3: 
	fnBuningInformation(); 
	break;
	case 4: 
	fnRules(); 
	break;
	case 5: 
	system("reset");
        fnMainScreen(); 
        break;
	default: exit(0);
}   //switch closed here
}   //function closed here

	void bus::fnTicketStatus()
	{
	 reset("system");
	char c;
	int ticket;
	FILE* fp;
	int flag=1;
	cout<<"\n\n\n\t\t\t TICKET STATUS";
	   fnPrintLine();
	cout<<"\n\n\t ENTER THE TICKET NUMBER ";
	cin>>ticket;
	cout<<"\n\t ENTER THE ROUTE DESTINATION ";
	cout<<"\n\n\t BANGALORE(B)\t AHEMDABAD(A)\t BHOPAL(P)\t GOA(G)\t";
	c=getchar();
  	if(c=='B'||c=='b')
	{
	  fp=fopen(Bus1.dat","rb");
	  while(fread(&b,sizeof(bus),1, fp);
	  {
	        if(ticket==ticketno)
               {
    		flag=0;
   		fnPrintLine();

                      cout<<"\n\n\n\t Ticket No: "<<ticketno;
                      cout<<"\n\n\t Seat No: "<<seatno;
                      cout<<"\n\tNAME: "<<name;
                      cout<<"\n\t AGE: "<<age;
                      cout<<"\n\t SEX: "<<sex;
                      cout<<"\n\n\t FARE: Rs 200 \t FROM: mumbai";
                      cout<<"\n\t DESTINATION: Goa \t TIME: 0430 hrs";
                      cout<<"\n\tDATE OF JOURNEY: "<<date<<"/"<<month<<endl;
                fnPrintLine();
               }
	    }  //while closed here
   	        fclose(fp);

        	if(flag==1)
        	{
        	cout<<"\n\n\n\t YOUR TICKET IS NOT RESERVED";
        	}
  		fnEnquiry();
  	}

	else if(c=='A'||c=='a')
	{
  	  fp=fopen(Bus2.dat","rb");
	  while(fread(&b,sizeof(bus),L, fp);
	   {
	        if(ticket==ticketno)
  	        {
   	        flag=0;
   	        fnPrintLine();
                     cout<<"\n\n\n\t Ticket No: "<<ticketno;
                     cout<<"\n\n\t Seat No: "<<seatno;
                     cout<<"\n\tNAME: "<<name;
                     cout<<"\n\t AGE: "<<age;
                     cout<<"\n\t SEX: "<<sex;
                     cout<<"\n\n\t FARE: Rs 200 \t FROM: mumbai";
                     cout<<"\n\t DESTINATION: Goa \t TIME: 0430 hrs";
                     cout<<"\n\tDATE OF JOURNEY: "<<date<<"/"<<month<<endl;
                fnPrintLine();

	        }
	  }
                fclose(fp);

	        if(flag==1)
	        {
	        cout<<"\n\n\n\t YOUR TICKET IS NOT RESERVED";
	        }
                fnEnquiry();
 	}    

	else if(c=='P'||c=='p')
	{
	fp=fopen(Bus3.dat","rb");
	while(fread(&b,sizeof(bus),1, fp);
	  {
	        if(ticket==ticketno)
  	        {
       	        flag=0;
                fnPrintLine();
                      cout<<"\n\n\n\t Ticket No: "<<ticketno;
                      cout<<"\n\n\t Seat No: "<<seatno;
                      cout<<"\n\tNAME: "<<name;
                      cout<<"\n\t AGE: "<<age;
                      cout<<"\n\t SEX: "<<sex;
                      cout<<"\n\n\t FARE: Rs 200 \t FROM: mumbai";
                      cout<<"\n\t DESTINATION: Goa \t TIME: 0430 hrs";
                      cout<<"\n\tDATE OF JOURNEY: "<<date<<"/"<<month<<endl;
                fnPrinLine();
 	        }
	  }
                fclose(fp);

	        if(flag==1)
  	        {
  	        cout<<"\n\n\n\t YOUR TICKET IS NOT RESERVED";
  	        }
  	        fnEnquiry();
       }     


	else if(c=='G'||c=='g')
	{
 	 fp=fopen(Bus4.dat","rb");
	 while(fread(&b,sizeof(bus),1, fp);
	 {
	        if(ticket==ticketno)
  	        {
   	        flag=0;
   	        fnPrintLine();
                      cout<<"\n\n\n\t Ticket No: "<<ticketno;
                      cout<<"\n\n\t Seat No: "<<seatno;
                      cout<<"\n\tNAME: "<<name;
                      cout<<"\n\t AGE: "<<age;
                      cout<<"\n\t SEX: "<<sex;
                      cout<<"\n\n\t FARE: Rs 200 \t FROM: mumbai";
                      cout<<"\n\t DESTINATION: Goa \t TIME: 0430 hrs";
                      cout<<"\n\tDATE OF JOURNEY: "<<date<<"/"<<month<<endl;	

   
   	        fnPrinLine();
 	        }
	 }
 	        fclose(fp);

	        if(flag==1)
  	        {
 	        cout<<"\n\n\n\t YOUR TICKET IS NOT RESERVED";
                }
	        fnEnquiry();
      }    

	else
	{
	cout<<"\n\n\t\t\t WRONG INPUT ";
	COUT<<"\n\n\n";
	fnEnquiry();
	}
}   // function closed here
   

...................................
  Function Seat Availability
...................................

void bus::fnSeatAvailability()
{
	int dateno; int count=0;
	int monthno;   FILE* fp;	
	char c=':';
	cout<<"\n\n\n\t Enter the date of journey";
	cin>>dateno;
	cout<<"\n\t Enter the month ";
	cin>>monthno;
	cout<<"\n\t Enter the destination";
	cout<<"\n\n\t BANGALORE(B)\t AHEMDABAD(A)\t BHOPAL(p)\t GOA(G)\t";
  	c=getchar();

	if(c=='B'||c=='b')
	{
	  fp=fopen("Bus1.dat","rb");
 	  while(fread(&b,sizeof(bus),1,fp)
            {
             if(date==dateno && month==monthno)
 	     count++;
            }
	fclose(fp);
	cout<<"\n\n\n\t TOTAL SEATS= 40";
	cout<<"\n\t REMAINING SEATS ="<<40-count;
	if(count==40)
	  {
	  cout<<"\n\n\n\t SORRY!!NO SEAT AVAILABLE";
	  }
	  fnEnquiry();
       }

      else if(c=='A'||c=='a')
	{
	  fp=fopen("Bus2.dat","rb");
	 while(fread(&b,sizeof(bus),1,fp)
	  {
	   if(date==dateno && month==monthno)
           count++;
          }
	fclose(fp);
	cout<<"\n\n\n\t TOTAL SEATS= 40";
	cout<<"\n\t REMAINING SEATS ="<<40-count;
	if(count==40)
	 {
	 cout<<"\n\n\n\t SORRY!!NO SEAT AVAILABLE";
         }
  	fnEnquiry();
       }

     else if(c=='P||c=='p')
       {
  	fp=fopen("Bus3.dat","rb");
 	while(fread(&b,sizeof(bus),1,fp)
  	  {
  	   if(date==dateno && month==monthno)
           count++;
  	  }
	 fclose(fp);
	 cout<<"\n\n\n\t TOTAL SEATS= 40";
	 cout<<"\n\t REMAINING SEATS ="<<40-count;
	  if(count==40)
	     {
	   cout<<"\n\n\n\t SORRY!!NO SEAT AVAILABLE";
	     }
	  fnEnquiry();
       }

      else if(c=='G'||c=='g')
        {
          fp=fopen("Bus4.dat","rb");
         while(fread(&b,sizeof(bus),1,fp)
  	  {
           if(date==dateno && month==monthno)
           count++;
          }
	  fclose(fp);
	  cout<<"\n\n\n\t TOTAL SEATS= 40";
	  cout<<"\n\t REMAINING SEATS ="<<40-count;
	  if(count==40)
               {
	     cout<<"\n\n\n\t SORRY!!NO SEAT AVAILABLE";
	       }
  	  fnEnquiry();
        }


	void fnPrintLine()
	{
	int j;
	for(j=0; j<60; j++)
	printf("*");
	}

